<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        html,
        body {
            width: 100%;
            height: 100%;
            background: gold;
            margin: 0;
            overflow: hidden;
        }
        
        .btn {
            margin: 0;
            padding: 0;
            position: absolute;
            right: -50%;
            width: 50%;
            height: 100%;
            background-color: pink;
            transition: all 1s;
        }
        
        .btn1 {
            margin: 0;
            padding: 0;
            position: absolute;
            right: 0%;
            width: 50%;
            height: 100%;
            background-color: pink;
            transition: all 1s;
        }
    </style>
</head>

<body>
    <div id="app">
        <div class="btn" v-bind:class="date"></div>
        <button v-on:click="right">按钮</button>
    </div>
</body>
<script src="./vue.js"></script>
<script>
    let vm = new Vue({
        el: '#app',
        data: {
            date: {
                btn1: false
            }
        },
        methods: {
            right() {
                this.date.btn1 = !this.date.btn1
            }
        },
    })
</script>

</html>